{% extends 'base.html' %}
{% block head %}
    {% if classify %}
        <title>{{ classify }}</title>
    {% else %}
        <title>热爱全栈的小张--首页</title>
    {% endif %}
{% endblock %}

{% block main-wrapper %}
    {% if status_code %}
        <div class="intro-wrapper">
            <div class="intro-content">
        <span>
            Hello! 我是<span class="wrapper">张业頔</span>
        </span>
                <p class="intro">
                    在这里,我会分享我的学习心得,记录我学习编程路上的点滴,并总结各种学习资源分享给大家.希望我的经历可以对大家有所启发.
                </p>
                <span class="qq">QQ:178320369</span>
                <ul class="icon">
                    <li>
                        <a href="#"><i class="fab fa-weixin"></i></a>
                    </li>
                    <li>
                        <a href="#"><i class="fab fa-weibo"></i></a>
                    </li>
                    <li>
                        <a href="#"><i class="fab fa-github"></i></a>
                    </li>
                    <li>
                        <a href="#"><i class="fab fa-linkedin"></i></a>
                    </li>
                </ul>
                <button><a href="https://space.bilibili.com/356477192">去b站关注</a></button>
            </div>
        </div>
    {% endif %}
    <div class="main-wrapper" style="margin-top: 80px">
        <div class="title">

            {% if classify %}
                <span>{{ classify }}</span>
            {% else %}
                <span>最新博客</span>
            {% endif %}
            <svg width="31" height="31" viewBox="0 0 31 31" fill="none" xmlns="http://www.w3.org/2000/svg">
                <path d="M25.8333 5.16666H5.16668C3.73293 5.16666 2.59626 6.31624 2.59626 7.74999L2.58334 23.25C2.58334 24.6837 3.73293 25.8333 5.16668 25.8333H25.8333C27.2671 25.8333 28.4167 24.6837 28.4167 23.25V7.74999C28.4167 6.31624 27.2671 5.16666 25.8333 5.16666ZM10.9792 19.375H9.42918L6.13543 14.8542V19.375H4.52084V11.625H6.13543L9.36459 16.1458V11.625H10.9792V19.375ZM17.4375 13.2525H14.2083V14.6992H17.4375V16.3267H14.2083V17.7604H17.4375V19.375H12.2708V11.625H17.4375V13.2525ZM26.4792 18.0833C26.4792 18.7937 25.8979 19.375 25.1875 19.375H20.0208C19.3104 19.375 18.7292 18.7937 18.7292 18.0833V11.625H20.3438V17.4504H21.8033V12.9037H23.4179V17.4375H24.8646V11.625H26.4792V18.0833Z"
                      fill="#4490D6"></path>
            </svg>
        </div>
        <section class="posts">
            {% load filter %}
            {% for post in post_list %}
                <div class="post-item">
                    <div class="create-date">
                        <span class="day">{{ post.create_time|date:"d"|mod }}</span>
                        <span class="month">{{ post.create_time|date:"Y-m" }}</span>
                    </div>
                    <div class="post">
                        <div class="title">{{ post.title }}</div>
                        <div class="tags">
                            <i class="fa fa-tags"></i>
                            {% for tag in post.tags.all %}
                                <span class="tag-item"><a href="">{{ tag.tag_name }} </a></span>

                            {% endfor %}


                        </div>
                        <p class="content">
                            {{ post.describe }}
                        </p>
                        <div class="bottom">
                            <div class="visitor">
                                <i class="fa fa-eye"></i>
                                <span class="visitor_num">{{ post.visitor_num }}</span>
                            </div>
                            <button><a href="/post_detail/?id={{ post.id }}">阅读原文</a></button>

                        </div>
                    </div>

                </div>
            {% endfor %}
        </section>

    </div>
    <div class="page-button" style="max-width: 1080px;margin: 0 auto">
        {% if post_list.has_previous %}
            <div class="prev">
                <a href="/?page={{ post_list.previous_page_number }}&classify={{ classify }}"><i
                        class="fa fa-angle-double-left"></i><span>Newer Entries</span></a>
            </div>
        {% endif %}
        {% if post_list.has_next %}
            <div class="next">
                <a href="/?page={{ post_list.next_page_number }}&classify={{ classify }}"><span>Older Entries</span><i
                        class="fa fa-angle-double-right"></i></a>
            </div>
        {% endif %}
    </div>
{% endblock %}
{% block footer %}
    <footer>
        <section class="footer-menus">
            <ul>
                <li>Social</li>
                <li>GitHub</li>
                <li>Bilibili</li>
                <li>博客</li>
            </ul>
            <ul>
                <li>联系我</li>
                <li>QQ:178320369</li>
                <li>Email:178320369@qq.com</li>
            </ul>
        </section>
    </footer>
{% endblock %}


